{
return g_vfs_get_file_for_path (g_vfs_get_local (), path);
}
+
+const char *
+ot_gfile_get_path_cached (GFile *file)
+{
+ const char *path;
+
+ path = g_object_get_data ((GObject*)file, "ostree-file-path");
+ if (!path)
+ {
+ path = g_file_get_path (file);
+ g_object_set_data_full ((GObject*)file, "ostree-file-path", (char*)path, (GDestroyNotify)g_free);
+ }
+ return path;
+}
+
+
+const char *
+ot_gfile_get_basename_cached (GFile *file)
+{
+ const char *name;
+
+ name = g_object_get_data ((GObject*)file, "ostree-file-name");
+ if (!name)
+ {
+ name = g_file_get_basename (file);
+ g_object_set_data_full ((GObject*)file, "ostree-file-name", (char*)name, (GDestroyNotify)g_free);
+ }
+ return name;
+}
GFile *ot_util_new_file_for_path (const char *path);
+const char *ot_gfile_get_path_cached (GFile *file);
+
+const char *ot_gfile_get_basename_cached (GFile *file);
+
gboolean ot_util_ensure_directory (const char *path, gboolean with_parents, GError **error);
char * ot_util_get_file_contents_utf8 (const char *path, GError **error);